<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ name }} | Xmind2TestCase Preview</title>
    <link rel="shortcut icon" href="{{ url_for('static',filename='favicon.ico') }}" type="image/x-icon"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ url_for('static',filename='css/pure-min.css') }}">
    <link rel="stylesheet" type="text/css" media="all" href="{{ url_for('static',filename='css/custom.css') }}">
</head>
<body>
<div class="header">
    <h1>{{ name }} - Preview</h1>
    <h2>TestSuites: {{ suite_count }}
        / <a href="{{ url_for("download_zentao_file",filename= name) }}">Get Zentao CSV</a>
        {#        / <a href="{{ url_for("download_testlink_file",filename= name) }}">Get TestLink XML</a>#}
        / <a href="{{ url_for("index") }}">Go Back</a></h2>
    <h2>总用例数:{{ steps_count }}条/一级用例数:{{ importance_one }}条/二级用例数:{{ importance_two }}条</h2>
    <h2>1,2级用例数占总用例数:{{ percentage }}%</h2>
</div>
<div>
    <a href="{{ url_for("local_save", filename= name) }}">
        <input style="font-size: 22px;margin-top: -120px;margin-right:150px;float: right" type="submit" class="pure-button " id="save" value="保存最终版本" />
    </a>
    <p style="font-size: 22px;margin-top: -120px;margin-right:150px;float: right">{{ msg }}</p>
</div>

<table class="pure-table tests-table">
    <thead>
    <tr>
        <th width="50">#</th>
        <th width="150px">Suite</th>
        <th width="5%">Priority</th>
        <th width="1500px">Title</th>
        <th width="100px">preconditions</th>
        <th width="100px">Attributes</th>
        <th width="23%">Steps</th>
        <th width="23%">expectedresults</th>
    </tr>
    </thead>
    <tbody>
    {% for test in suite %}
        <tr>
            {% if test.color == "2" %}
                <td class="add-color" style="background-color: #00b36b">{{ test.number }}</td>
                <td class="add-color" style="background-color: #00b36b">{{ test.suite }}</td>
                <td class="add-color" style="background-color: #00b36b">
                    {% if test.importance  == 1 %}
                        <div class="tag-success-1 tooltip">
                            优先级:{{ test.importance }}
                            <span class="tooltiptext">Priority {{ test.importance }} </span>
                        </div>
                    {% endif %}
                    {% if test.importance  == 2 %}
                        <div class="tag-success-2 tooltip">
                            优先级:{{ test.importance }}
                            <span class="tooltiptext">Priority {{ test.importance }} </span>
                        </div>
                    {% endif %}
                    {% if test.importance  == 3 %}
                        <div class="tag-success-3 tooltip">
                            优先级:{{ test.importance }}
                            <span class="tooltiptext">Priority {{ test.importance }} </span>
                        </div>
                    {% endif %}
                </td>
                <td class="add-color" style="background-color: #00b36b"
                    {% if test.name|length>100 %}class="long-name" {% endif %}>{{ test.name }}
                    {% if test.name|length>100 %}
                        <span class="long-name-info">Warn: test name might be too long: {{ test.name|length }}!</span>
                    {% endif %}
                </td>
                <td class="add-color" style="background-color: #00b36b">
                    {% if test.preconditions %}
                        <div class="pure-button tag-info tooltip">{{ test.preconditions | replace('\n','<br>') |safe }}
                            <p class="tooltiptext">
                                <b>前提条件:</b> <br>
                                {{ test.preconditions | replace('\n','<br>') |safe }}
                            </p></div>
                    {% endif %}
                </td>
                <td class="add-color" style="background-color: #00b36b">
                    {% if test.summary %}
                        <div class="pure-button tag-warn tooltip">需求编号:{{ test.summary | replace('\n','<br>') |safe }}
                            <p class="tooltiptext">
                                <b>相关需求</b> <br>
                                {{ test.summary | replace('\n','<br>') |safe }}
                            </p></div>
                    {% endif %}
                <td class="add-color" style="background-color: #00b36b">
                    {% if test.steps %}
                        <ol>
                            {% for step in test.steps %}
                                <li>{{ step.actions }}
                                </li>
                            {% endfor %}
                        </ol>
                    {% endif %}
                </td>
                <td class="add-color" style="background-color: #00b36b">
                    {% if test.steps %}
                        <ol>
                            {% for step in test.steps %}
                                {% if step.expectedresults %}
                                    <li>{{ step.expectedresults }}</li>
                                {% endif %}
                            {% endfor %}
                        </ol>
                    {% endif %}
                </td>
            {% else %}
                <td>{{ test.number }}</td>

                <td>{{ test.suite }}</td>
                <td>
                    {% if test.importance  == 1 %}
                        <div class="tag-success-1 tooltip">
                            优先级:{{ test.importance }}
                            <span class="tooltiptext">Priority {{ test.importance }} </span>
                        </div>
                    {% endif %}
                    {% if test.importance  == 2 %}
                        <div class="tag-success-2 tooltip">
                            优先级:{{ test.importance }}
                            <span class="tooltiptext">Priority {{ test.importance }} </span>
                        </div>
                    {% endif %}
                    {% if test.importance  == 3 %}
                        <div class="tag-success-3 tooltip">
                            优先级:{{ test.importance }}
                            <span class="tooltiptext">Priority {{ test.importance }} </span>
                        </div>
                    {% endif %}
                </td>
                {#            {% if loop.index  == 3 %}#}
                {#                <td style="background-color: #00aeff">#}
                {#                </td>#}
                {#            {% endif %}#}
                <td {% if test.name|length>100 %}class="long-name" {% endif %}>{{ test.name }}
                    {% if test.name|length>100 %}
                        <span class="long-name-info">Warn: test name might be too long: {{ test.name|length }}!</span>
                    {% endif %}
                </td>
                <td>
                    {% if test.preconditions %}
                        <div class="pure-button tag-info tooltip">{{ test.preconditions | replace('\n','<br>') |safe }}
                            <p class="tooltiptext">
                                <b>前提条件:</b> <br>
                                {{ test.preconditions | replace('\n','<br>') |safe }}
                            </p></div>
                    {% endif %}
                </td>
                <td>
                    {% if test.summary %}
                        <div class="pure-button tag-warn tooltip">需求编号:{{ test.summary | replace('\n','<br>') |safe }}
                            <p class="tooltiptext">
                                <b>相关需求</b> <br>
                                {{ test.summary | replace('\n','<br>') |safe }}
                            </p></div>
                    {% endif %}
                <td>
                    {% if test.steps %}
                        <ol>
                            {% for step in test.steps %}
                                <li>{{ step.actions }}
                                </li>
                            {% endfor %}
                        </ol>
                    {% endif %}
                </td>
                <td>
                    {% if test.steps %}
                        <ol>
                            {% for step in test.steps %}
                                {% if step.expectedresults %}
                                    <li>{{ step.expectedresults }}</li>
                                {% endif %}
                            {% endfor %}
                        </ol>
                    {% endif %}
                </td>
            {% endif %}
        </tr>
        {#        {% endfor %}#}
    {% endfor %}
    </tbody>
</table>
<div class="footer">
    <a href="{{ url_for('static', filename='guide/index.html') }}" target="_blank">User Guide</a> |
    <a href="https://github.com/zhuifengshen/xmind2testcase/issues/new" target="_blank">Report Issue</a> |
    Powered by <a href="https://github.com/zhuifengshen/xmind2testcase" target="_blank">XMind2TestCase</a>
</div>
</body>
</html>